package cn.yuanqiao.web.controller.archive.Identify;/**
 * @author 赵常飞
 * @date 2023/7/10 10:16
 */

import cn.yuanqiao.archive.Identify.domain.TenantYqJdFile;
import cn.yuanqiao.archive.Identify.domain.TenantYqKfjdJob;
import cn.yuanqiao.archive.Identify.service.IIsOpenIdentify;
import cn.yuanqiao.archive.appManager.domain.TenantCategory;
import cn.yuanqiao.archive.appManager.service.ITenantCategoryService;
import cn.yuanqiao.common.utils.DateUtils;
import cn.yuanqiao.common.web.controller.BaseController;
import cn.yuanqiao.common.core.domain.AjaxResult;
import cn.yuanqiao.common.web.page.TableDataInfo;
import cn.yuanqiao.common.annotation.Log;
import cn.yuanqiao.common.enums.BusinessType;

import cn.yuanqiao.common.core.context.ResponseUtils;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson2.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 *
 *@AUTHOR:赵常飞
 *@date 2023/7/10 10:16
 */
@RestController
@RequestMapping("/archive/isopenidentify")
public class IsOpenIdentifyController extends BaseController {
    @Autowired
    private IIsOpenIdentify isOpenIdentify;

    @Autowired
    private ITenantCategoryService categoryService;
    /**
     * 获取业务数据列表
     */
    @Log(title = "开放鉴定获取档案列表", businessType = BusinessType.SELECT)
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody JSONObject json)
    {
        //startPage();
        List<Map<String,Object>> list = isOpenIdentify.getlist(json);
        return getDataTable(list);
    }
    /** 获取任务列表*/
    @Log(title = "开放鉴定获取任务列表", businessType = BusinessType.SELECT)
    @PostMapping("/kfjdjoblist")
    public TableDataInfo kfjdjoblist(@RequestBody JSONObject json)
    {
        startPage();
        List<Map<String,Object>> list = isOpenIdentify.kfjdjoblist(json);
        return getDataTable(list);
    }
    /** 添加任务 */
    @PreAuthorize("@ss.hasPermi('archive:isopens:add')")
    @Log(title = "添加开放鉴定任务", businessType = BusinessType.INSERT)
    @PostMapping("/addjob")
    public AjaxResult addjob(@RequestParam(value="remark",required=false)String remark,@RequestParam("jiandingrenwuname")String jiandingrenwuname,@RequestParam("renwuno")String renwuno,@RequestParam("qzh")String qzh,@RequestParam("qzhcode")String qzhcode,
                             @RequestParam(value="jiandingleader",required=false)Long jiandingleader,@RequestParam(value="chushenpeople",required=false)String chushenpeople,@RequestParam(value="fushenpeople",required=false)String fushenpeople,
                             @RequestParam(value="shendingpeople",required=false)Long shendingpeople,@RequestParam("jiandingstartdate")String jiandingstartdate,@RequestParam("categoryId")Long categoryId,
                             @RequestParam(value="mj",required=false)String mj, MultipartFile file) throws IOException {
        int addjob = isOpenIdentify.addjob(jiandingrenwuname, renwuno, qzh,qzhcode, jiandingleader, chushenpeople, fushenpeople, shendingpeople, jiandingstartdate, categoryId, file,remark,mj);
        return toAjax(addjob);
    }
    /** 获取任务信息 */
    @Log(title = "获取开放鉴定任务信息", businessType = BusinessType.SELECT)
    @GetMapping(value = "/getjobinfo/{Id}")
    public AjaxResult getjobinfo(@PathVariable("Id") Long Id)
    {
        return success(isOpenIdentify.getjobinfo(Id));
    }
    /** 上传文件 */
    @Log(title = "上传开放鉴定任务附件", businessType = BusinessType.UPLOAD)
    @PostMapping("/upload")
    public AjaxResult upload(@RequestParam("renwuid")Long renwuid,@RequestParam(value="mj",required=false)String mj,MultipartFile file) throws IOException {
        TenantYqJdFile upload = isOpenIdentify.upload(renwuid,mj, file);
        return success(upload);
    }
    /** 删除文件 */
    @Log(title = "删除开放鉴定任务附件", businessType = BusinessType.DELETE)
    @GetMapping("/deletefile/{Id}")
    public AjaxResult deletefile(@PathVariable("Id") Long Id)
    {
        return toAjax(isOpenIdentify.deletefile(Id));
    }
    /** 下载文件 */
    @Log(title = "下载开放鉴定任务附件", businessType = BusinessType.DOWNLOAD)
    @PostMapping("/download/{Id}")
    public void download(@PathVariable("Id") Long Id, HttpServletRequest request, HttpServletResponse response)throws Exception
    {
        TenantYqJdFile yqJdFile=isOpenIdentify.getfilebyid(Id);
        String filePath=yqJdFile.getPath()+File.separator+yqJdFile.getRealFileName();
        File f = new File(filePath);
        if (!f.exists()) {
            response.sendError(404, "File not found!");
            //return ResponseData.error("File not found!");
        }
        BufferedInputStream br = new BufferedInputStream(new FileInputStream(f));
        byte[] buf = new byte[1024];
        int len = 0;
        boolean isOnLine=true;
        response.reset(); // 非常重要
        // 设置 CORS 响应头
        ResponseUtils.defaultResponse(response);
        String  fileName= yqJdFile.getFileName();

        if (isOnLine) { // 在线打开方式
            URL u = new URL("file:///" + filePath);
            response.setContentType(u.openConnection().getContentType());
            response.setHeader("Content-Disposition", "inline; filename=" + fileName);
            // 文件名应该编码成UTF-8
        } else { // 纯下载方式
            response.setContentType("application/x-msdownload");
            response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
        }
        OutputStream out = response.getOutputStream();
        while ((len = br.read(buf)) > 0){
            out.write(buf, 0, len);
        }
        br.close();
        out.close();
    }
    /** 修改任务信息 */
    @Log(title = "更新开放鉴定任务信息", businessType = BusinessType.UPDATE)
    @PostMapping("/updatejobinfo")
    public AjaxResult updatejobinfo(@RequestBody TenantYqKfjdJob yqKfjdJob)
    {
        return toAjax(isOpenIdentify.updatejobinfo(yqKfjdJob));
    }
    /** 删除任务 */
    @Log(title = "删除开放鉴定任务", businessType = BusinessType.DELETE)
    @DeleteMapping("/deletejob/{Id}")
    public AjaxResult deletejob(@PathVariable("Id") Long Id)
    {
        return success(isOpenIdentify.deletejob(Id));
    }

    /** 撤销任务 */
    @Log(title = "撤销开放鉴定任务", businessType = BusinessType.UPDATE)
    @PreAuthorize("@ss.hasPermi('archive:isopens:cxjd')")
    @PostMapping("/chexiaojob/{Id}")
    public AjaxResult chexiaojob(@PathVariable("Id") Long Id)
    {
        return success(isOpenIdentify.chexiaojob(Id));
    }

    /** 添加档案到任务单 */
    @Log(title = "添加档案到开放鉴定任务", businessType = BusinessType.INSERT)
    @PostMapping("/addarchive")
    public AjaxResult addarchive(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.addarchive(json));
    }
    /** 删除任务中的档案 */
    @Log(title = "删除开放鉴定任务中的档案", businessType = BusinessType.DELETE)
    @PostMapping("/deletearchive")
    public AjaxResult deletearchive(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.deletearchive(json));
    }
    /** 调档完成 */
    @Log(title = "开放鉴定调档完成", businessType = BusinessType.UPDATE)
    @GetMapping("/completedd/{id}")
    public AjaxResult completedd(@PathVariable("id") Long Id)
    {
        return toAjax(isOpenIdentify.completedd(Id));
    }
    /** 获取任务单内的列表 */
    @Log(title = "获取开放鉴定任务中的档案", businessType = BusinessType.SELECT)
    @PostMapping("/getdatalistbyrenwuid")
    public TableDataInfo getdatalistbyrenwuid(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.getdatalistbyrenwuid(json);
        return getDataTable(list);
    }
    /** 获取任务总数、初审分配完成数、复审分配完成数 */
    @Log(title = "获取任务总数、初审分配完成数、复审分配完成数", businessType = BusinessType.SELECT)
    @GetMapping("/getcsfsallnumbyrenwuid/{id}")
    public AjaxResult getcsfsallnumbyrenwuid(@PathVariable("id") Long Id)
    {
        return success(isOpenIdentify.getcsfsallnumbyrenwuid(Id));
    }
    /** 当前人是否有分配任务的权限 */
    @Log(title = "当前人是否有分配任务的权限", businessType = BusinessType.SELECT)
    @GetMapping("/hasfenpeipro/{id}")
    public AjaxResult hasfenpeipro(@PathVariable("id") Long id)
    {
        return success(isOpenIdentify.hasfenpeipro(id));
    }

    /** 当前人是否有修改任务的权限 */
    @Log(title = "当前人是否有修改任务的权限", businessType = BusinessType.SELECT)
    @GetMapping("/hasupdatepro/{id}")
    public AjaxResult hasupdatepro(@PathVariable("id") Long id)
    {
        return success(isOpenIdentify.hasupdatepro(id));
    }
    /** 平均初审分配获取任务名/总数/初审人员 */
    @Log(title = "平均初审分配获取任务名/总数/初审人员", businessType = BusinessType.SELECT)
    @GetMapping("/getinfonumperson/{id}")
    public AjaxResult getinfonumperson(@PathVariable("id") Long id)
    {
        return success(isOpenIdentify.getinfonumperson(id));
    }

    /** 初审/复审平均分配列表 */
    @Log(title = "初审/复审平均分配列表", businessType = BusinessType.SELECT)
    @PostMapping("/cspjfplist")
    public TableDataInfo cspjfplist(@RequestBody JSONObject json)
    {

        List<Map<String,Object>> list = isOpenIdentify.cspjfplist(json);
        return getDataTable(list);
    }

    /** 平均初审分配 */
    @Log(title = "平均初审分配", businessType = BusinessType.UPDATE)
    @PostMapping("/pjfprw")
    public AjaxResult pingjunfenpeirenwu(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.pingjunfenpeirenwu(json));
    }
    /** 标记分配 */
    @Log(title = "标记分配", businessType = BusinessType.UPDATE)
    @PostMapping("/markfp")
    public AjaxResult markfp(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.markfp(json));
    }
    /** 手动分配列表 */
    @Log(title = "手动分配列表", businessType = BusinessType.UPDATE)
    @PostMapping("/sdfplist")
    public TableDataInfo sdfplist(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.sdfplist(json);
        return getDataTable(list);
    }
    /** 提交手动分配 */
    @Log(title = "提交手动分配", businessType = BusinessType.UPDATE)
    @PostMapping("/commitsdfp")
    public AjaxResult commitsdfp(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.commitsdfp(json));
    }
    /** 重新分配 */
    @Log(title = "重新分配", businessType = BusinessType.UPDATE)
    @PostMapping("/refp")
    public AjaxResult refp(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.refp(json));
    }
    /** 调整人员 */
    @Log(title = "调整人员", businessType = BusinessType.UPDATE)
    @PostMapping("/tzry")
    public AjaxResult tzry(@RequestBody JSONObject json)
    {
        return toAjax(isOpenIdentify.tzry(json));
    }
    /** 发起鉴定 */
    @PreAuthorize("@ss.hasPermi('archive:isopens:fqjd')")
    @Log(title = "发起鉴定", businessType = BusinessType.UPDATE)
    @PostMapping("/fqjd/{renwuid}")
    public AjaxResult fqjd(@PathVariable("renwuid") Long renwuid)
    {
        return toAjax(isOpenIdentify.fqjd(renwuid));
    }
    /** 追踪任务状态 */
    @PreAuthorize("@ss.hasPermi('archive:isopens:follow')")
    @Log(title = "追踪任务状态", businessType = BusinessType.SELECT)
    @GetMapping("/followd/{renwuid}")
    public AjaxResult followd(@PathVariable("renwuid") Long renwuid)
    {
        return success(isOpenIdentify.followd(renwuid));
    }
    /** 获取当前人的初审任务 */
    @Log(title = "获取当前人的初审任务", businessType = BusinessType.SELECT)
    @GetMapping("/getchushenjob")
    public AjaxResult getchushenjob()
    {
        return success(isOpenIdentify.getchushenjob());
    }
    /** 获取当前人的初审数量 */
    @Log(title = "获取当前人的初审数量", businessType = BusinessType.SELECT)
    @GetMapping("/getchushennum/{renwuid}/{userId}")
    public AjaxResult getchushennum(@PathVariable("renwuid") Long renwuid,@PathVariable("userId") Long userId)
    {
        return success(isOpenIdentify.getchushennum(renwuid,userId));
    }
    /** 获取当前人初审列表 */
    @Log(title = "获取当前人初审列表", businessType = BusinessType.SELECT)
    @PostMapping("/cssplist")
    public TableDataInfo cssplist(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.cssplist(json);
        return getDataTable(list);
    }
    /** 初审/复审提交 */
    @Log(title = "初审/复审提交", businessType = BusinessType.UPDATE)
    @PostMapping("/chushentijiao")
    public AjaxResult chushentijiao(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.chushentijiao(json));
    }
    /** 修改审定开放控制 */
    @Log(title = "修改审定开放控制", businessType = BusinessType.UPDATE)
    @PostMapping("/updateshending")
    public AjaxResult updateshending(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.updateshending(json));
    }
    /** 修改鉴定理由 */
    @Log(title = "修改鉴定理由", businessType = BusinessType.UPDATE)
    @PostMapping("/updateliyou")
    public AjaxResult updateliyou(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.updateliyou(json));
    }

    /** 修改鉴定备注 */
    @Log(title = "修改鉴定备注", businessType = BusinessType.UPDATE)
    @PostMapping("/updatebeizhu")
    public AjaxResult updatebeizhu(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.updatebeizhu(json));
    }

    /** 获取内部列表 */
    @Log(title = "获取内部列表", businessType = BusinessType.SELECT)
    @PostMapping("/getdetaillist")
    public TableDataInfo getdetaillist(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.getdetaillist(json);
        return getDataTable(list);
    }
    /** 获取当前人的复审任务 */
    @Log(title = "获取当前人的复审任务", businessType = BusinessType.SELECT)
    @GetMapping("/getfushenjob")
    public AjaxResult getfushenjob()
    {
        return success(isOpenIdentify.getfushenjob());
    }
    /** 获取当前人的复审数量 */
    @Log(title = "获取当前人的复审数量", businessType = BusinessType.SELECT)
    @GetMapping("/getfushennum/{renwuid}/{userid}")
    public AjaxResult getfushennum(@PathVariable("renwuid") Long renwuid,@PathVariable("userid") Long userid)
    {
        return success(isOpenIdentify.getfushennum(renwuid,userid));
    }

    /** 获取当前人复审列表 */
    @Log(title = "获取当前人复审列表", businessType = BusinessType.SELECT)
    @PostMapping("/fssplist")
    public TableDataInfo fssplist(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.fssplist(json);
        return getDataTable(list);
    }
    /** 抽查 */
    @Log(title = "抽查", businessType = BusinessType.UPDATE)
    @PostMapping("/choucha")
    public AjaxResult choucha(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.choucha(json));
    }

    /** 获取当前人的审定任务 */
    @Log(title = "获取当前人的审定任务", businessType = BusinessType.SELECT)
    @GetMapping("/getsdjoblist")
    public AjaxResult getsdjoblist()
    {
        return success(isOpenIdentify.getsdjoblist());
    }
    /** 获取当前人审定列表 */
    @Log(title = "获取当前人审定列表", businessType = BusinessType.SELECT)
    @PostMapping("/sdlist")
    public TableDataInfo sdlist(@RequestBody JSONObject json)
    {
        List<Map<String,Object>> list = isOpenIdentify.sdlist(json);
        return getDataTable(list);
    }
    /** 修改审定结果 */
    @Log(title = "修改审定结果", businessType = BusinessType.UPDATE)
    @PostMapping("/changesdresult")
    public AjaxResult changesdresult(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.changesdresult(json));
    }
    /** 审定提交 */
    @Log(title = "审定提交", businessType = BusinessType.UPDATE)
    @PostMapping("/shendingtijiao")
    public AjaxResult shendingtijiao(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.shendingtijiao(json));
    }
    /** 鉴定生效 */
    @Log(title = "鉴定生效", businessType = BusinessType.UPDATE)
    @PreAuthorize("@ss.hasPermi('archive:isopens:jdsx')")
    @PostMapping("/jiandingshengxiao")
    public AjaxResult jiandingshengxiao(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.jiandingshengxiao(json));
    }
    /** 再次鉴定 */
    @Log(title = "再次鉴定", businessType = BusinessType.UPDATE)
    @PostMapping("/jiandingagin")
    public AjaxResult jiandingagin(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.jiandingagin(json));
    }
    /** 统计 */
    @Log(title = "统计", businessType = BusinessType.SELECT)
    @PostMapping("/tongji")
    public AjaxResult tongji(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.tongji(json));
    }
    /** 获取初审/复审人员 */
    @Log(title = "获取初审/复审人员", businessType = BusinessType.SELECT)
    @PostMapping("/getuser")
    public AjaxResult getuser(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.getuser(json));
    }
    /** 导出任务表 */
    @Log(title = "导出任务表", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('archive:isopens:export')")
    @PostMapping("/exportjob")
    public void exportjob(@RequestParam("ids") String idsstring,HttpServletResponse response) throws IOException {
        // 这里注意 有同学反应使用swagger 会导致各种问题，请直接用浏览器或者用postman
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");
        String fileName = URLEncoder.encode("开放鉴定任务导出表"+ DateUtils.dateTimeNow("yyyyMMddHHmmss"), "UTF-8").replaceAll("\\+", "%20");
        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
        List<List<String>> headList = isOpenIdentify.getexportjobth(); //表头
        List list= Arrays.asList(idsstring.split(","));
        List<List<String>> dataList = isOpenIdentify.getexportjobdata(list); //数据
        EasyExcel.write(response.getOutputStream()).head(headList).sheet("开放鉴定任务导出表").doWrite(dataList);
    }
    /** 敏感词库导出 */
    @Log(title = "敏感词库导出", businessType = BusinessType.EXPORT)
    @PostMapping("/exportck")
    public void exportck(@RequestParam(value="ids",required = false) String idsstring,HttpServletResponse response) throws IOException {
        JSONObject json=new JSONObject();
        List list=new ArrayList();
        if(null==idsstring){

        }else{
            list= Arrays.asList(idsstring.split(","));
        }
        json.put("ids",list);
        // 这里注意 有同学反应使用swagger 会导致各种问题，请直接用浏览器或者用postman
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");
        String fileName = URLEncoder.encode("敏感词库导出表"+ DateUtils.dateTimeNow("yyyyMMddHHmmss"), "UTF-8").replaceAll("\\+", "%20");
        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
        List<List<String>> headList = isOpenIdentify.getexportckth(); //表头
        List<List<String>> dataList = isOpenIdentify.getexportckdata(json); //数据
        EasyExcel.write(response.getOutputStream()).head(headList).sheet("敏感词库导出表").doWrite(dataList);
    }
    /** 导出记录中的档案条目 */
    @Log(title = "导出记录中的档案条目", businessType = BusinessType.EXPORT)
    @PostMapping("/exportjobda")
    public void exportjobda(@RequestParam(value = "renwuid")Long renwuid,@RequestParam(value = "menuId")Long menuId,@RequestParam(value = "ids")String ids,@RequestParam(value = "order",required = false)String order,@RequestParam(value = "fields")String fields, HttpServletResponse response) throws IOException {
        // 这里注意 有同学反应使用swagger 会导致各种问题，请直接用浏览器或者用postman
        JSONObject json=new JSONObject();
        json.put("renwuid",renwuid);
        json.put("menuId",menuId);
        List list= Arrays.asList(ids.split(","));
        json.put("ids",list);
        json.put("order",order);
        json.put("fields",fields);
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");
        String fileName = URLEncoder.encode("任务内数据导出表"+ DateUtils.dateTimeNow("yyyyMMddHHmmss"), "UTF-8").replaceAll("\\+", "%20");
        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
        List<List<String>> headList = isOpenIdentify.exportjobdath(json); //表头
        List<List<String>> dataList = isOpenIdentify.exportjobdadata(json); //数据
        EasyExcel.write(response.getOutputStream()).head(headList).sheet("任务内数据导出表").doWrite(dataList);
    }
    /** 统计导出 */
    @Log(title = "统计导出", businessType = BusinessType.EXPORT)
    @PostMapping("/exporttongji")
    public void exporttongji(@RequestParam(value="type",required = true) String type,@RequestParam(value="level",required = false) String level,@RequestParam(value="userid",required = false) String userid,HttpServletResponse response) throws IOException {
        JSONObject json=new JSONObject();
        json.put("type",type);
        json.put("level",level);
        json.put("userid",userid);
        // 这里注意 有同学反应使用swagger 会导致各种问题，请直接用浏览器或者用postman
        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        response.setCharacterEncoding("utf-8");
        String fileName = URLEncoder.encode("划控鉴定统计导出表"+ DateUtils.dateTimeNow("yyyyMMddHHmmss"), "UTF-8").replaceAll("\\+", "%20");
        response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
        List<List<String>> headList = isOpenIdentify.exporttongjith(json); //表头
        List<List<String>> dataList = isOpenIdentify.exporttongjidata(json); //数据
        EasyExcel.write(response.getOutputStream()).head(headList).sheet("划控鉴定统计导出表").doWrite(dataList);
    }
    /** 获取初审/复审人员 */
    @Log(title = "根据任务id获取初审/复审人员", businessType = BusinessType.SELECT)
    @PostMapping("/getuserbyrenwuid")
    public AjaxResult getuserbyrenwuid(@RequestBody JSONObject json)
    {
        return success(isOpenIdentify.getuserbyrenwuid(json));
    }
    /***
     * 获取抽查数量/大于百分比
     */
    @Log(title = "获取抽查数量/大于百分比", businessType = BusinessType.SELECT)
    @PostMapping("/getchouchanum/{renwuid}")
    public AjaxResult getchouchanum(@PathVariable("renwuid")Long renwuid)
    {
        return success(isOpenIdentify.getchouchanum(renwuid));
    }



    /**
     * 档案门类获取已定义的树
     * @author syd
     * @param yqdacategorymodel
     * @return
     */
    @Log(title = "档案门类获取树", businessType = BusinessType.SELECT)
    @GetMapping("/getcatemodeltree")
    public AjaxResult getcatemodeltree(TenantCategory yqdacategorymodel){
        return success(categoryService.selectTreeList(yqdacategorymodel));
    }
    //判断能否修改门类
    @PostMapping("/editcate/{id}")
    public AjaxResult editcate(@PathVariable("id") Long id)
    {
        return success(isOpenIdentify.editcate(id));
    }
}
